/*
* Copyright (c) 2014 Qunar.com. All Rights Reserved.
*/
package net.oschina.bilbodai.concurrent.proxy;

import net.sf.cglib.proxy.Enhancer;
import net.sf.cglib.proxy.MethodInterceptor;

/**
 * @author daimao  Date: 15/10/14 Time: 上午10:11
 * @version $Id$
 */
public class CglibProxy {

    public static Object createProxy(Class<?> target, MethodInterceptor interceptor) {
        Enhancer enhancer = new Enhancer();
        enhancer.setSuperclass(target);
        enhancer.setCallback(interceptor);
        return enhancer.create();
    }

}